﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Microsoft.Reporting.WebForms;
using Ewts.Code;

namespace Ewts.RDLC
{
    public partial class AgoCollectStorageRDLC : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BindData();
            }
        }

        private void BindData()
        {
            string insid = "";
            if (Request["insid"] != null && Request["insid"].ToString().Trim() != "")
            {
                insid = Request["insid"].ToString().Trim();

                DataTable dt = new DataLib.BLL.unProcessed().GetList(" inSid=" + insid).Tables[0];
                if (dt!=null&&dt.Rows.Count>0)
                {
                    ReportDataSource rds = new ReportDataSource("AgoCollectStorageDS", dt);
                    AgoCollectReportViewer.LocalReport.DataSources.Clear();
                    AgoCollectReportViewer.LocalReport.DataSources.Add(rds);
                    new RDLCPrinter().FillRow(dt, 3, 20, 20);
                    AgoCollectReportViewer.LocalReport.Refresh();
                }
            }
        }

    }
}